﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Windows.Forms;

namespace IWebApp2
{
    public partial class Profile : System.Web.UI.Page
    {
        #region variables
        //this varibales will hold Vcard informations
        public static String str1 = String.Empty;
        public static String str2 = String.Empty;
        public static String str3 = String.Empty;
        public static String str4 = String.Empty;
        public static String str5 = String.Empty;
        public static String str6 = String.Empty;
        public static String str7 = String.Empty;
        public static String str8 = String.Empty;
        public static String str9 = String.Empty;
        #endregion


        protected void Page_Load(object sender, EventArgs e)
        {
            //display informations to TextBoxes, don't enable them  
            TextBox1.Text = str1;
            TextBox2.Text = str2;
            TextBox3.Text = str3;
            TextBox4.Text = str4;
            TextBox5.Text = str5;
            TextBox6.Text = str6;
            TextBox7.Text = str7;
            TextBox8.Text = str8;
            TextBox9.Text = str9;

            TextBox1.Enabled = false;
            TextBox2.Enabled = false;
            TextBox3.Enabled = false;
            TextBox4.Enabled = false;
            TextBox5.Enabled = false;
            TextBox6.Enabled = false;
            TextBox7.Enabled = false;
            TextBox8.Enabled = false;
            TextBox9.Enabled = false;
        }

        /// <summary>
        /// Edit Button
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {   //Enable TextBoxes, when an option to edit was chosen (Edit button was clicked)
            TextBox1.Enabled = true;
            TextBox2.Enabled = true;
            TextBox3.Enabled = true;
            TextBox4.Enabled = true;
            TextBox5.Enabled = true;
            TextBox6.Enabled = true;
            TextBox7.Enabled = true;
            TextBox8.Enabled = true;
            TextBox9.Enabled = true;
        }

        /// <summary>
        /// Close Button
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
        {
            //redirect to blank.htm in order to notify iframe that a navigation occured
            //which eventually will close the iframe
            Response.Redirect("blank.htm");
            this.Dispose();
            
        }
    }
}
